<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">
	
<h:head>
<title>Ricerca pacchetti predefiniti </title>
		<link rel="stylesheet" type="text/css" href="style/reset.css" media="screen,print" />
		<link rel="stylesheet" type="text/css" href="style/print.css" media="print" />
		<link rel="stylesheet" type="text/css" href="style/style.css" media="screen,print" />
		<link rel="stylesheet" type="text/css" href="style/template.css" media="screen" />
		<link rel="stylesheet" type="text/css" href="style/menu.css" media="screen" />
		<link rel="stylesheet" type="text/css" href="pcss/pagina-3.css" media="screen" />
	</h:head>


<h:body onload="#{ricerca.loadDataPred()}">
		<div id="imHeaderBg"></div>
		<div id="imFooterBg"></div>
		<div id="imPage">
			<div id="imHeader">
				<h1 class="imHidden">Area Personale</h1>
			</div>
			<a class="imHidden" href="#imGoToCont" title="Salta il menu di navigazione">Vai ai contenuti</a>
			<a id="imGoToMenu"></a><p class="imHidden">Menu principale:</p>
			<div id="imMnMn" class="auto">
				<ul class="auto">
					<li id="imMnMnNode0">
						<a href="http://localhost:8080/TravelDreamOnlineWeb">
							<span class="imMnMnFirstBg">
								<span class="imMnMnTxt"><span class="imMnMnImg"></span>Home Page</span>
							</span>
						</a>
					</li><li id="imMnMnNode3" class="imMnMnCurrent">
						<a href="http://localhost:8080/TravelDreamOnlineWeb/user/index.xhtml">
							<span class="imMnMnFirstBg">
								<span class="imMnMnTxt"><span class="imMnMnImg"></span>Area Personale</span>
							</span>
						</a>
					</li><li id="imMnMnNode4">
						<a href="http://localhost:8080/TravelDreamOnlineWeb/admin/index.xhtml">
							<span class="imMnMnFirstBg">
								<span class="imMnMnTxt"><span class="imMnMnImg"></span>Area Riservata</span>
							</span>
						</a>
					</li><li id="imMnMnNode5">
						<a href="http://localhost:8080/TravelDreamOnlineWeb/contatti.html">
							<span class="imMnMnFirstBg">
								<span class="imMnMnTxt"><span class="imMnMnImg"></span>Contatti</span>
							</span>
						</a>
					</li>
				</ul>
			</div>
			<div id="imContentGraphics"></div>
			<div id="imContent">
			
<!--INSERIRE QUI LA PAGINA>
/////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////
<-->	

	<h:form> 
	<h1>Ricerca pacchetti predefiniti</h1> 
	<p:growl id="growl" showDetail="true" sticky="true" /> 
	<p:contextMenu for="dataTable">  
	 	<p:menuitem value="Dettaglio" update="display" icon="ui-icon-search" action="#{pacchettoPredBean.dettaglioPacchetto(ricerca.selectedPredPacchetto)}"/>  
        <p:menuitem value="Paga pacchetto" update="growl" icon="ui-icon-search" action="#{acquistoBean.pagaPacchettoPredefinito(ricerca.selectedPredPacchetto)}"/>
        <p:menuitem value="Personalizza" action="#{pacchettoBean.convertPredPers(ricerca.selectedPredPacchetto)}" icon="ui-icon-search" />  
    </p:contextMenu>  
    

    <p:dataTable id="dataTable" var="pack" value ="#{ricerca.getPacchettiPred()}" widgetVar="carsTable"   
            emptyMessage="Nessun elemento trovato" filteredValue="#{ricerca.filteredPacchettoPred}"
            rowKey="#{pack.idPacchettoPredefinito}" selection="#{ricerca.selectedPredPacchetto}" selectionMode="single">  

        <p:column filterBy="nome"   
                headerText="Nome"
                filterMatchMode="contains">  
            <h:outputText value="#{pack.nome}" />  
        </p:column> 
        
        <p:column filterBy="data"   
                headerText="Data"
                filterMatchMode="contains">  
            <h:outputText value="#{pack.data}" />  
        </p:column>   
        
        <p:column filterBy="totale"   
                headerText="Prezzo"
                filterMatchMode="contains">  
            <h:outputText value="#{pack.totale}" />  
        </p:column>   
        
        
    </p:dataTable>  

      <p:dialog header="DettagliPacchetto" widgetVar="elementDialog" resizable="false" id="carDlg"  
                showEffect="fade" hideEffect="explode" modal="true">  
  
        <h:panelGrid id="display" columns="2" cellpadding="4" style="margin:0 auto;">  
  
            <p:dataTable var="elemento" value="#{ricerca.selectedPredPacchetto.elementi}">  
            	<p:column headerText="Nome">  
                	<h:outputText value="#{elemento.nome}" />  
            	</p:column>  
  	 		</p:dataTable>  
        </h:panelGrid>  
  
    </p:dialog>  
    
        <p:commandButton value="Indietro" oncomplete = "window.history.back();"/>
</h:form>
<!--FINE DELLA PAGINA>
/////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////
<-->						
				
								
			</div>		
			<div id="imFooter">
				
			</div>
	</div>
		<span class="imHidden"><a href="#imGoToCont" title="Rileggi i contenuti della pagina">Torna ai contenuti</a> | <a href="#imGoToMenu" title="Naviga ancora nella pagina">Torna al menu</a></span>
		
	<noscript class="imNoScript"><div class="alert alert-red">Per poter utilizzare questo sito è necessario attivare JavaScript.</div></noscript>
				</h:body>
</html>
